-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: iframe rendering optimization #35959
base: master
Are you sure you want to change the base?
chore: iframe rendering optimization #35959
Conversation
Thanks for the pull request, @PKulkoRaccoonGang! This repository is currently maintained by @openedx/wg-maintenance-edx-platform. Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
196fa73
to
5205573
Compare
90e61dd
to
64c4b07
Compare
return window.addEventListener( | ||
'message', | ||
(event) => { | ||
if (event.data && event.data.type === 'completeXBlockDuplicating') { | ||
return self.onNewXBlock(placeholderElement, null, true, event.data.payload); | ||
} | ||
}, | ||
{ once: true } | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, sorry, now that I look at this again, I realize that { once: true }
will be a problem. If an unrelated message
event comes in before completeXBlockDuplicating
, the listener will be called for that other message, and do nothing. But then the event handler will be unregistered. Then, when the completeXBlockDuplicating
message comes in, nothing will happen.
I think you need some other approach to ensure that the event listener is only called once, either by unregistering itself within the if (event.data && event.data.type === 'completeXBlockDuplicating') {
section, or add this event listener during the overall init and have it always listening rather than temporarily registering it here.
🚨 Dependencies:
Description
This PR provides iframe reload optimizations for various xblock related actions. Added some improvements related to scrolling to the current xblock. Fixed behavior of the xblock action dropdown list.
Testing instructions
Screen.Recording.2025-01-20.at.9.21.47.AM.mov
Other information
Improvements to the editing modals and tagging will be added in future PRs.